package com.ruoyi.finance.protal.service;

import com.alibaba.fastjson.JSONObject;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.finance.livestreaming.entity.RewardWithVO;
import com.ruoyi.finance.livestreaming.vo.CounterChargeVO;
import com.ruoyi.finance.rules.entity.SzPromotionTreeVO;
import com.ruoyi.finance.rules.entity.SzUser;
import org.springframework.web.multipart.MultipartFile;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.math.BigDecimal;
import java.util.List;
import java.util.Map;

public interface ProtalUserService {

    /**
     * 登录
     * @param user
     * @return
     */
    AjaxResult login(SzUser user, HttpServletRequest request);

    /**
     * 用户注册
     * @param nickname, phone, password, confirmPassword, verificationCode, invitationParent
     */
    AjaxResult register(SzUser user);

    /**
     * 用户注册-发送验证码
     * @param phone
     * @return
     */
    AjaxResult SendRegisterCode(String phone);

    /**
     * 个人中心-获取个人数据
     * @param request
     * @return
     */
    AjaxResult getInfo(HttpServletRequest request);

    /**
     * 个人中心-购买数字人直播-保存订单
     * @param request
     * @return
     */
    AjaxResult saveSzOrder(HttpServletRequest request);

    /**
     * 个人中心-购买数字人直播-订单轮询
     * @param request
     * @return
     */
    AjaxResult orderPolling(String orderId, HttpServletRequest request);

    /**
     * 个人中心-购买数字人直播-订单支付回调
     * @return
     */
    Map<String, String> receiveNotice(JSONObject dataJson);
    Map<String, String> receiveNoticePay(JSONObject dataJson);

    /**
     * H5支付 创建订单
     * @param request
     * @param response
     * @return
     */
    AjaxResult createOrderH5(HttpServletRequest request, HttpServletResponse response);

    /**
     * 个人中心-上传用户头像
     * @param file
     * @param request
     * @return
     */
    AjaxResult uploadPicture(MultipartFile file, HttpServletRequest request);

    /**
     * H5 余额变动详情
     * @param userId
     * @return
     */
    AjaxResult balanceDetailAdmin(String userId);

    /**
     * H5 数字直播对冲
     * @param fromUser
     * @param toUser
     * @return
     */
    AjaxResult mutualRecharge(String fromUser, String toUser);

    /**
     * 查询用户简单信息
     * @return
     */
    List<Map<String, String>> listSzUserSimple(String userName);

    /**
     * H5 数字直播对冲
     * @param counterChargeVO
     * @return
     */
    AjaxResult mutualRechargeFree(CounterChargeVO counterChargeVO);

    /**
     * 数字直播对冲提现余额
     * @param fromUser
     * @param toUser
     * @param money
     * @param paymentPassword
     * @return
     */
    AjaxResult mutualRechargeBalance(String fromUser, String toUser, BigDecimal money, String paymentPassword);

    /**
     * 礼物打赏
     * @param userId
     * @param rewardedUser
     * @param giftId
     * @param price
     * @param count
     * @return
     */
    AjaxResult rewardWithGifts(Long userId, Long rewardedUser, Long giftId, BigDecimal price, BigDecimal count);

    /**
     * 用户购买记录 h5
     * @param userId
     * @return
     */
    Map<String, Object> purchaseRecord(Long userId);

    /**
     * 个人中心-查询下级用户
     * @param request
     * @return
     */
    SzPromotionTreeVO userInviteTree(HttpServletRequest request);

    /**
     * 购买数字直播
     * @param userId
     * @param parentId
     * @return
     */
    AjaxResult buyLivestreaming(String userId, String parentId);

    /**
     * 用户可提现余额细明
     * @param userId
     * @return
     */
    Map<String, Object> withdrawalBalance(Long userId);

    /**
     * 用户绑定银行卡
     * @param cardId
     * @param bankName
     * @param bankAddress
     * @return
     */
    AjaxResult saveBankCard(String realName, String cardId, String bankName, String bankAddress, HttpServletRequest request);

    /**
     * 可提现余额提现
     * @param amount
     * @param paymentPassword
     * @param request
     * @return
     */
    AjaxResult withdraw(BigDecimal amount, String paymentPassword, HttpServletRequest request);

    /**
     * 设置支付密码
     * @param paymentPassword
     * @param request
     * @return
     */
    AjaxResult setPaymentPassword(String paymentPassword, HttpServletRequest request);

    /**
     * 个人中心-提现记录查询
     * @param request
     * @return
     */
    AjaxResult withdrawRecord(HttpServletRequest request);

    /**
     * 用户注册-通过手机号
     * @param user
     * @return
     */
    AjaxResult innerRegister(SzUser user);

    /**
     * 新直播打赏
     * @param vo
     * @return
     */
    AjaxResult innerRewardWithGifts(RewardWithVO vo) throws Exception;

    /**
     * 购买数字直播2
     * @param userId
     * @return
     */
    AjaxResult buyLivestreaming2(String userId);
}
